<template>
  <el-dialog
    title="提交反馈"
    append-to-body
    width="100%"
    class="child_matter_dialog"
    :visible.sync="showSupervise"
    v-if="showSupervise"
    destroy-on-close
  >
    <div class="content">
      <slot></slot>

      <slot name="footer">
        <div class="cancel_btn" @click="cancelClick" v-if="cancelVisible">
          取消
        </div>
      </slot>
    </div>
  </el-dialog>
</template>

<script>
export default {
  name: "sz-dialog",
  props: {
    visible: {
      type: Boolean,
      default: false
    },
    cancelVisible: {
      type: Boolean,
      default: false
    },
    title: {
      type: String,
      default: ""
    }
  },
  data() {
    return {
      showSupervise: false
    };
  },
  watch: {
    visible(val) {
      console.log(val, 1);
      this.showSupervise = val;
    }
  },
  methods: {
    cancelClick() {
      this.showSupervise = false;
      this.$emit("cancelClick", false);
    }
  }
};
</script>

<style lang="less" scoped>
.child_matter_dialog {
  margin: 0px 20px;
  /deep/ .el-dialog__header {
    display: none;
  }

  /deep/ .el-dialog__body {
    padding: 0px;
  }
  .content {
    position: fixed;
    bottom: 0px;
    left: 0px;
    right: 0px;
    width: 100%;

    .cancel_btn {
      background-color: white;
      line-height: 60px;
      text-align: center;
      font-size: 16px;
      font-family: Source Han Sans CN;
      font-weight: bold;
      border-top: 1px solid #f5f6fa;
      color: #fa4441;
      opacity: 1;
    }
    .content_header {
      background-color: white;
      line-height: 60px;
      text-align: center;
      border-bottom: 1px solid #cecece;

      font-size: 16px;
      font-family: Source Han Sans CN;
      font-weight: bold;

      color: #303030;
      opacity: 1;
    }
  }
}
</style>
